{% extends "tcms_base.html" %}
{% load static %}
{% block subtitle %}{{ test_plan }}{% endblock %}

{% block extra_head %}
{{ form.media }}
{% endblock %}

{% block custom_stylesheet %}
<link rel="stylesheet" type="text/css" href="{% static 'style/print.css' %}" media="print" />
<style>
#tab_testcases{ padding-left:5px;}
#tab_testruns {padding-left:5px;}
</style>
{% endblock %}

{% block custom_javascript %}
<script type="text/javascript" src="{% static 'js/testplan_actions.js' %}"></script>
<script type="text/javascript" src="{% static 'js/testcase_actions.js' %}"></script>
<script type="text/javascript">
Nitrate.Utils.after_page_load(Nitrate.TestPlans.Edit.on_load);
</script>
{% endblock %}

{% block content_type %}
	<input type="hidden" name="content_type" value="testplans.testplan" />
	<input type="hidden" name="object_pk" value="{{ test_plan.pk }}" />
	<input type="hidden" name="name" value="{{ test_plan.name }}" />
	<input type="hidden" name="description" value="{{ test_plan.latext_text.plan_text }}" />
{% endblock %}

{% block contents %}

<div id="content">
	<input id="id_plan_id" type="hidden" name="plan_id" value="{{ test_plan.plan_id }}">
	<form action="{% url "plan-edit" test_plan.plan_id %}" method="post" enctype="multipart/form-data">
		<div id="" class="Detailform border-1">
			<table class="editor" cellspacing="0">
				<tr>
					<td width="20%"><label class="lab strong" id="title_id">Plan Name</label></td>
					<td>
						<span class="name summary">{{ form.name }}</span>
						<span class="errors">{{ form.name.errors }}</span>
					</td>
				</tr>
				<tr>
					<td>
						<label clas"strong">{{ form.is_active.label }}</label>
					</td>
					<td>
						<span>{{ form.is_active }}</span>
					</td>
				</tr>
				<tr>
					<td><label class="lab">Author</label></td>
					<td>
						<span id="display_author" class="name"><a href="{% url "tcms-profile" test_plan.author.username %}">{{ test_plan.author.username }}</a></span>
					</td>
				</tr>
				<tr>
					<td><label class="lab">Owner</label></td>
					<td>
						<span class="name " />{{ form.owner }}</span>
						<span class="errors">{{ form.owner.errors }}</span>
					</td>
				</tr>
				<tr>
					<td>
						<label class="lab">Product</label>
					</td>
					<td>
						<span class="name summary">{{ form.product }}</span>
						<span class="errors">{{ form.product.errors }}</span>
					</td>
				</tr>
				<tr>
					<td>
						<label class="lab">Product Version</label>
					</td>
					<td>
						<span class="name summary">{{ form.product_version }}</span>
						<span class="errors">{{ form.product_version.errors }}</span>
					</td>
				</tr>
				<tr>
					<td>
						<label class="lab strong">Plan Type</label>
					</td>
					<td>
						<div class="name">{{ form.type }}</div>
						<div class="errors">{{ form.type.errors }}</div>
					</td>
				</tr>
                <tr>
                    <td>
                        <label class="lab">Parent ID</label>
                    </td>
                    <td>
                        <div class="name">{{ form.parent }}</div>
                        <div class="errors">{{ form.parent.errors }}</div>
                    </td>
                </tr>
				<tr>
					<td><label class="lab strong">Plan Document</label></td>
					<td>
						<div>
							{{ form.text }}
						</div>
						<div class="errors">{{ form.text.errors }}</div>
					</td>
				</tr>
				<tr>
					<td><label class="lab">Reference Link</label></td>
					<td>
						<div class="name summary">{{ form.extra_link }}</div>
						<div class="errors">{{ form.extra_link.errors }}</div>
					</td>
				</tr>
				<tr>
				    <td><label>Notification include</label></td>
				    <td>
				        <div>{{ form.auto_to_plan_owner }}{{ form.auto_to_plan_owner.label }}{{ form.auto_to_plan_owner.errors }}</div>
				        <div>{{ form.auto_to_plan_author }}{{ form.auto_to_plan_author.label }}{{ form.auto_to_plan_author.errors }}</div>
				        <div>{{ form.auto_to_case_owner }}{{ form.auto_to_case_owner.label }}{{ form.auto_to_case_owner.errors }}</div>
				        <div>{{ form.auto_to_case_default_tester }}{{ form.auto_to_case_default_tester.label }}{{ form.auto_to_case_default_tester.errors }}</div>
				    </td>
				</tr>
				<tr>
				    <td><label>Notification Trigger</label></td>
				    <td>
				       
				       <div>{{ form.notify_on_plan_update }}{{ form.notify_on_plan_update.label }}{{ form.notify_on_plan_update.errors }}</div>
				       <div>{{ form.notify_on_case_update }}{{ form.notify_on_case_update.label }}{{ form.notify_on_case_update.errors }}</div>
				    </td>
				</tr>
			</table>
			<div class="submit-row" id="control_box">
				<input type="submit" value="Save" />
				<input type="reset" value="Reset" />
			</div>
		</div>
	</form>
</div>
{% endblock %}
